package com.sixth.controller;

import com.sixth.core.entity.CareHistory;
import com.sixth.core.vo.R;
import com.sixth.service.CareHistoryService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @program: sixth-hospital-parent
 * @description:
 * @author: 李劲锋
 * @create: 2024-08-15 11:13
 **/
@RestController
@RequestMapping( "/charge")
@Api(tags = "查询缴费账单")
public class CareHistoryController {

    @Autowired
    private CareHistoryService careHistoryService;


    @PostMapping( "/select/{registrationId}")
    @ApiOperation(value = "查询缴费账单")
    public R<List<CareHistory>> query(@PathVariable String registrationId) {
        return careHistoryService.selectById(registrationId);
    }

    @PostMapping( "/selectFee/{registrationId}")
    @ApiOperation(value = "查询退费账单")
    public R<List<CareHistory>> queryBackFee(@PathVariable String registrationId) {
        return careHistoryService.selectByIdFee(registrationId);
    }

    /**
     * 获取订单详情
     * @param chId orderState 病例id
     */
    @GetMapping("/orderDetails/{chId}")
    @ApiOperation(value = "获取订单详情")
    public R orderDetails(@PathVariable String chId) {
        return careHistoryService.orderDetails(chId);
    }

}
